from brian import *
from brian.library.random_processes import *
from brian.library.synapses import  *
#set_global_preferences(useweave=True,usecodegenweave = True)
import mydata as  mydat

class MNVars(mydat.globVars):
    
    #Specific
    p=0.1
    f=0.01
    kca=2/ms
    kd=0.2*10**-2*mole*dmetre**-3
    Elmn=-65*mV
    DUR=50
    
    
    
    cpf=(1*ufarad*cm**-2)
    alpha=0.009*mole/(amp*second)*um**-1
    gk=(100*msiemens*cm**-2) # war 36*
    gl=(0.51*msiemens*cm**-2) #
    gna=(120*msiemens*cm**-2) #
    invtau=1/mydat.globVars.taue
    gsynapse=50*uS*cm**-2
    gcan=(14*msiemens*cm**-2)
    gc=(0.1*msiemens*cm**-2)
    gcal=(0.33*msiemens*cm**-2)
    gkca=(5*msiemens*cm**-2)
    vinit1 = -61.4557
    vinit2 = -59.835
    #Dendrit
    
    cpfDe=(1*ufarad*cm**-2)
    glDe=(0.51*msiemens*cm**-2) #
    gnapDe=(0*msiemens*cm**-2) #
    alphaDe=0.0009*mole/(amp*second)*um**-1
    gcanDe=(0.3*msiemens*cm**-2)
    gcDe=(0.1*msiemens*cm**-2)
    gcalDe=(0.33*msiemens*cm**-2)
    gkcaDe=(1.1*msiemens*cm**-2)
    #Overwrite
    
    def __init__(self):
        
        self.DUR2=3*self.DUR
#        self.area=10000*umetre*umetre
#        self.alpha=0.0009*mole/(amp*second)*um**-3
#        self.gcan=(14*msiemens*cm**-2)*self.area
#        self.gc=(0.1*msiemens*cm**-2)*self.area
#        self.gcal=(0.33*msiemens*cm**-2)*self.area
#        self.gkca=(5*msiemens*cm**-2)*self.area
#        self.gk=(100*msiemens*cm**-2)*self.area
#        self.gl=(0.51*msiemens*cm**-2)*self.area
#        self.gna=(120*msiemens*cm**-2)*self.area
#        #Dendrit
#        self.areaDe=90000*umetre*umetre
#        self.cpfDe=(1*ufarad*cm**-2)*self.areaDe
#        self.glDe=(0.51*msiemens*cm**-2)*self.areaDe #
#        self.gnapDe=(0*msiemens*cm**-2)*self.areaDe #
#        self.alphaDe=0.0009*mole/(amp*second)*um**-3
#        self.gcanDe=(0.3*msiemens*cm**-2)*self.areaDe
#        self.gcDe=(0.1*msiemens*cm**-2)*self.areaDe
#        self.gcalDe=(0.33*msiemens*cm**-2)*self.areaDe
#        self.gkcaDe=(1.1*msiemens*cm**-2)*self.areaDe
#        #Test
#        self.cpf=(1*ufarad*cm**-2)*self.area
#        self.invtau=1/self.taue
#        self.gsynapse=50*uS*cm**-2*self.area
        
        
        